
// The Ambiguity of Fishing for Fun, October 2022
// This file uses data from MRIP to save the catch-per-trip distribution and to generate the catch-at-length distribution for summer flounder in 2020

use MRIP_data.dta, clear //data from MRIP data request on catch-per-trip for the different species and years
keep if year==2020
drop year
keep if species=="summerflounder"
keep tot_cat n_trips se1
outsheet using "FlukeCatchPerTrip2020.txt", replace 


use MRIP_data2.dta, clear //data from MRIP data request on catch-at-length for the different species and years
keep if year==2020
drop year
keep if species=="summerflounder"
collapse(sum) tot_cat, by (length_inches)
drop if mi(length_inches)
egen total_catch=sum(tot_cat)
gen p=tot_cat/total_catch
keep length_inches p
outsheet using "ProbFlukeSizes2020.txt", replace 
